<?php
declare (strict_types = 1);

namespace app\common\model;

class UserBonus extends Base
{

    protected $name = 'user_bonus';

    public function user()
    {
        return $this->hasOne(User::class, 'id', 'uid')->field('id,code,nickname,photo,mobile,level_id');
    }
    
    public function bonus()
    {
        return $this->hasOne(Bonus::class, 'id', 'bonus_id')->field('id,title');
    }
}
